<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- emb-fonts.qdoc -->
  <title>Qt for Embedded Linux Fonts | Qt 5.14</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="index.html">Qt 5.14</a></td><td >Qt for Embedded Linux Fonts</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.14.2 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#freetype-formats">FreeType Formats</a></li>
<li class="level1"><a href="#qt-prerendered-font-qpf2">Qt Prerendered Font (QPF2)</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Qt for Embedded Linux Fonts</h1>
<span class="subtitle"></span>
<!-- $$$qt-embedded-fonts.html-description -->
<div class="descr"> <a name="details"></a>
<p>Qt normally uses <code>fontconfig</code> to provide access to system fonts. If <code>fontconfig</code> is not available, e.g&#x2e; in dedicated embedded systems where space is at a premium, Qt will fall back to using <code>QBasicFontDatabase</code>. In this case, Qt applications will look for fonts in Qt's <code>lib/fonts/</code> directory. Qt will automatically detect prerendered fonts and TrueType fonts.</p>
<p>Qt uses the <a href="http://freetype.sourceforge.net/freetype2/index.html">FreeType 2</a> font engine to produce font output. The formats supported depends on the locally installed version of the <a href="qt-embedded-fonts.html#freetype">FreeType</a> library. When using QBasicFontDatabase, Qt also supports the Qt Prerendered Font format (<a href="qt-embedded-fonts.html#qpf2">QPF2</a>), a light-weight non-scalable font formats. QPF2 is the native format of Qt for Embedded Linux 4.x&#x2e;</p>
<p class="centerAlign"><img src="images/qt-embedded-fontfeatures.png" alt="" /></p><p>All supported fonts use the Unicode character encoding. Most fonts available today do, but they usually don't contain <i>all</i> the Unicode characters. A complete 16-point Unicode font uses over 1 MB of memory.</p>
<a name="freetype"></a><a name="freetype-formats"></a>
<h2 id="freetype-formats">FreeType Formats</h2>
<p>The <a href="http://freetype.sourceforge.net/freetype2/index.html">FreeType 2</a> library can support the following font formats:</p>
<ul>
<li>TrueType (TTF)</li>
<li>PostScript Type1 (PFA/PFB)</li>
<li>Bitmap Distribution Format (BDF)</li>
<li>CID-keyed Type1</li>
<li>Compact Font Format (CFF)</li>
<li>OpenType fonts</li>
<li>SFNT-based bitmap fonts</li>
<li>Portable Compiled Format (PCF)</li>
<li>Microsoft Windows Font File Format (Windows FNT)</li>
<li>Portable Font Resource (PFR)</li>
<li>Type 42 (limited support)</li>
</ul>
<p>It is possible to add modules to the <a href="http://freetype.sourceforge.net/freetype2/index.html">FreeType 2</a> font engine to support other types of font files. For more information, see the font engine's own website: <a href="http://freetype.sourceforge.net/freetype2/index.html">http://freetype.sourceforge.net/freetype2/index.html</a>.</p>
<p>Glyphs rendered using <a href="qt-embedded-fonts.html#freetype">FreeType</a> are shared efficiently between applications, reducing memory requirements and speeding up text rendering.</p>
<a name="qpf2"></a><a name="qt-prerendered-font-qpf2"></a>
<h2 id="qt-prerendered-font-qpf2">Qt Prerendered Font (QPF2)</h2>
<p>The Qt Prerendered Font (QPF2) is an architecture-independent, light-weight and non-scalable font format.</p>
<p>Qt comes with the cross-platform <a href="qt-embedded-makeqpf.html">makeqpf</a> tool, included in the <code>tools</code> directory, which allows generation of QPF2 files from system fonts.</p>
<p>QPF2 supports anti-aliasing and complex writing systems, using information from the corresponding TrueType font, if present on the system. The format is designed to be mapped directly to memory. The same format is used to share glyphs from non-prerendered fonts between applications.</p>
</div>
<!-- @@@qt-embedded-fonts.html -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
